Attribute VB_Name = "Module13"
Private Declare Function ECF_VerificaImpressoraLigada Lib "CONVECF.DLL" () As Integer
Private Declare Function ECF_FlagsFiscais Lib "CONVECF.DLL" (ByRef FlagFiscal As Integer) As Integer
Private Declare Function ECF_VerificaEstadoImpressoraMFD Lib "CONVECF.DLL" (ByRef Ack As Integer, ByRef St1 As Integer, ByRef St2 As Integer, ByRef St3 As Integer) As Integer
Private Declare Function ECF_RetornoImpressoraMFD Lib "CONVECF.DLL" (ByRef Ack As Integer, ByRef St1 As Integer, ByRef St2 As Integer, ByRef St3 As Integer) As Integer
Private Declare Function ECF_StatusEstendidoMFD Lib "CONVECF.DLL" (ByRef iStatus As Integer) As Integer

Function ImpressoraLigada()
    
    retorno = ECF_VerificaImpressoraLigada()
    
    MsgBox " 'Verifica Impressora Ligada' " & vbCrLf & "Status: " & retorno
    If retorno = 1 Then
        Form1.List1.AddItem "Impressora Ligada: Impressora Ligada"
    Else
        Form1.List1.AddItem "Impressora Ligada: Problema na Comunicação"
    End If
End Function

Function FlagsFiscais()
    Dim Flag As Integer
    
    retorno = ECF_FlagsFiscais(Flag)
    
    MsgBox " 'Flags Fiscais' " & vbCrLf & "Status: " & retorno
    Form1.List1.AddItem "Flag Fiscal: " & Flag
End Function

Function EstadoImpressora()
    Dim iAck, iSt1, iSt2, iSt3 As Integer
    
    retorno = ECF_VerificaEstadoImpressoraMFD(iAck, iSt1, iSt2, iSt3)
    
    MsgBox " 'Verifica Estado da Impressora' " & vbCrLf & "Status: " & retorno
    Form1.List1.AddItem "Estado Impressora: " & iAck & ", " & iSt1 & ", " & iSt2 & ", " & iSt3
End Function

Function RetornoImpressora()
    Dim iAck, iSt1, iSt2, iSt3 As Integer
    
    retorno = ECF_RetornoImpressoraMFD(iAck, iSt1, iSt2, iSt3)
    
    MsgBox " 'Retorno da Impressora' " & vbCrLf & "Status: " & retorno
    Form1.List1.AddItem "RetornoImpressora: " & iAck & ", " & iSt1 & ", " & iSt2 & ", " & iSt3
End Function

Function StatusEstendido()
    Dim iStatus As Integer
    
    retorno = ECF_StatusEstendidoMFD(iStatus)
    
    MsgBox " 'Status Estendido' " & vbCrLf & "Status: " & retorno
    Form1.List1.AddItem "StatusEstendido: " & iStatus
End Function


